var Sport = {
	OnclickHandle:  function (path,id){
		App.OnclickHandle(path,id);
		Sport.ShowGroupInfo();
	},
	//日期控制
	setDate:function(date){
		$(".data-"+date).addClass("data-checked").parent().siblings().find("a").removeClass("data-checked");
		$(".date-time-"+date).show().siblings().hide();
	},
	//控制面板展开和收起
	upDown:function(fullDate){
		var ele = $("#slideDiv"+fullDate);
		if(ele.data("state") == "show"){
			ele.data("state","hide");
			ele.find("i").removeClass('fa-angle-right').addClass('fa-angle-down');
		}else{
			ele.data("state","show");
			ele.find("i").removeClass('fa-angle-down').addClass('fa-angle-right');
		}
		/*点击面板内容收缩或展开*/
		$(".slide-toggle-"+fullDate).slideToggle(50);
	},
	
	//查看参赛信息详情  参赛项目hid，竞赛项目名称，项目大项pid，项目大项名称
	ShowMatchInfo: function (hid,name,day,resultType) {
		if(!hid||!name){
			return;
		}
		var w = window.open();
		var url = "hid="+hid+"&name="+name+"&day="+day+"&pid="+App.pid+"&resultType="+resultType;
		
		url = base64encode(encodeURI(url));
		w.location = App.Path+"matchInfo?"+url;
	},
	//查看参赛信息详情  参赛项目hid，竞赛项目名称，项目大项pid，项目大项名称
	ShowMatchInfo1: function (hid,name,day,groupCid,GroupName,resultType) {
		if(!hid||!name){
			return;
		}
		var w = window.open();
		var url = "hid="+hid+"&name="+name+"&day="+day+"&pid="+App.pid+"&resultType="+resultType;

		url = base64encode(encodeURI(url));
		w.location = App.Path+"matchInfo?"+url;
	},
	//运动员列表
	ShowGroupList: function (cid,name) {
		var group = new Object;
		group.cid   = cid;
		group.name  = name;
		
		var url = "groupStr="+App.getObjJson(group)+"&pid="+App.pid;
		url = base64encode(encodeURI(url));
		window.location.href = App.Path+"groupList?"+url;
	},
	//运动员列表
	ShoAthleteList: function (cid,name) {
		$(".athlete-"+cid).addClass("textgreen").siblings().removeClass("textgreen").parent().parent().siblings().find("a").removeClass("textgreen");
		var group = new Object;
		var $content = $("#athleteList");
		group.cid  = cid;
		group.name = name;
		$("#projectName").text("运动员");
		$.ajax({
			type : 'POST',
			url : App.Path+'athleteList',
			data:{groupStr:App.getObjJson(group)},
			dataType : 'html',
			beforeSend : function() {
				$("#Loading").show();
			},
			complete: function () {
				$("#Loading").hide();
		    },
			success : function(html) {
				$content.html(html);
			}
		})
	},
	//控制组别
	ShowGroupInfo: function (fid,type) {
		var group = new Object;
		var $content = $("#content");
		if(fid){
			$(".group-"+fid).addClass("textgreen").parent().siblings().find("a").removeClass("textgreen");
		}
		group.cid = $content.data("cid");
		group.name = $content.data("name");
		$("#projectName").text("比赛日程");
		$.ajax({
			type : 'POST',
			url : App.Path+'content',
			data:{groupStr:App.getObjJson(group),fid:fid,type:type},
			dataType : 'html',
			beforeSend : function() {
				$("#Loading").show();
			},
			complete: function () {
				$("#Loading").hide();
		    },
			success : function(html) {
				$content.html(html);
			}
		})
	}
}